<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var num = 10;
        //使用.toString()转为字符串
        var str = num.toString();
        console.log(typeof num);//Number
        //使用String()强制转换为字符串
        String(num);
        console.log(typeof num);//Number
        console.log(String(num));
        console.log(num);
        //使用+隐式转换为字符串
        console.log(num + '');


    </script>
</head>

<body>

</body>

</html>